<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"
    errorPage=""
    import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>新增場地資料</title>
<script language="JavaScript">
  function formCheck()
  {
     if(document.form1.id.value == ""){
	      alert("請填寫場地編號");
		  document.form1.id.focus()
		  return false;
	 }
	 if(document.form1.name.value == ""){
	      alert("請填寫地點名稱");
		  document.form1.name.focus()
		  return false;
	 }	 
  }
</script>
</head>
<body>
<% if(session.getAttribute("access") == "y" ){%>
<jsp:useBean id="mydb" scope="page" class="bean.ConDbBean"/> <%//連結資料庫的bean %>
<% 
	  		String sql="select * from PLACE_CLASS";
	  		ResultSet rs=mydb.executeQuery(sql); 
	  		%>
	  		
<table width="750" border="0" align="center">
  <tr>
    <td width="30" rowspan="4"><jsp:include page="../frameset/left.jsp" flush="true" ></jsp:include></td>
    <td colspan="2"><jsp:include page="../frameset/top.jsp" flush="true" ></jsp:include></td>
    <td width="40" rowspan="4"><jsp:include page="../frameset/right.jsp" flush="true" ></jsp:include></td>
  </tr>
  <tr>
    <td rowspan="2"><jsp:include page="../frameset/mean.jsp" flush="true" ></jsp:include>

    </td>
    <td height="32"><jsp:include page="../frameset/pfm_mean.jsp" flush="true" ></jsp:include></td>
  </tr>
  <tr>
    <td>
    <table width="500" border="0" align="center">
  <tr>
    <td><form id="form1" name="form1" method="post" action="do_addPlace.jsp">
	<table width="400" border="1" align="center">
  <tr>
    <td width="27%">場地編號</td>
    <td width="73%">
      <input type="text" name="id" maxlength="11"/></td>
  </tr>
  <tr>
    <td>場地類別</td>
    <td>
    <select name="class">
    <% while(rs.next()){%>
    	<option value="<%=rs.getString("PC_ID")%>" ><%=rs.getString("PC_NAME")%></option>
    <%}
    %>
  		</select>
    </td>
  </tr>
  <tr>
    <td>地點名稱</td>
    <td><input type="text" name="name" maxlength="36"/></td>
  </tr>
  <tr align="center">
    <td colspan="2">系統描述</td>
  </tr>
  <tr>
    <td>可容納人數</td>
    <td><input type="text" name="person" maxlength="10"/>人</td>
  </tr>
  <tr>
    <td>是否有空調</td>
    <td><input name="air" type="radio" value="無" checked="checked" />無
  		<input name="air" type="radio" value="有" />有
  	</td>
  </tr>
  <tr>
    <td>隔音效果</td>
    <td><input name="deafening" type="radio" value="差" checked="checked" />差
  		<input name="deafening" type="radio" value="普通" />普通
  		<input name="deafening" type="radio" value="好" />好
  	</td>
  </tr>
   <tr>
    <td>音響設備</td>
    <td><input name="acoustics" type="radio" value="無" checked="checked" />無
  		<input name="acoustics" type="radio" value="有" />有
  	</td>
  </tr>
  <tr>
    <td>麥克風</td>
    <td><input name="mir" type="radio" value="無" checked="checked" />無
  		<input name="mir" type="radio" value="有" />有
  	</td>
  </tr>
  <tr>
    <td>投影屏幕</td>
    <td><input name="screen" type="radio" value="無" checked="checked" />無
  		<input name="screen" type="radio" value="有" />有
  	</td>
  </tr>
  <tr>
    <td>投影機</td>
    <td><input name="projector" type="radio" value="無" checked="checked" />無
  		<input name="projector" type="radio" value="有" />有
  	</td>
  </tr>
  <tr>
    <td>燈光效果</td>
    <td><input name="light" type="radio" value="白燈" checked="checked" />白燈
  		<input name="light" type="radio" value="黃燈" />黃燈
  		<input name="light" type="radio" value="兩段式" />兩段式
  	</td>
  </tr>
  <tr>
    <td>無線上網</td>
    <td><input name="wireless" type="radio" value="無" checked="checked" />無
  		<input name="wireless" type="radio" value="有" />有
  	</td>
  </tr>
  <tr>
    <td>LCD跑馬燈</td>
    <td><input name="lcd" type="radio" value="無" checked="checked" />無
  		<input name="lcd" type="radio" value="有" />有
  	</td>
  </tr>
  <tr>
    <td>備註</td>
    <td><textarea name="ps" rows="5" cols="30"></textarea></td>
  </tr>
  <tr align="center">
    <td colspan="2" ><input name="reset" type="reset" value="重新填寫" /><input name="add" type="submit" id="set" onClick="return formCheck()" value="新增" /></td>
   
  </tr>
</table>
    </form>
    </td>
  </tr>

</table>
    </td>
  </tr>
  <tr>
    <td colspan="2"></td>
  </tr>
</table>
<%
  }
  else{
  	response.sendRedirect("../index.jsp"); //若沒有登入則回到index.jsp
  } 
  %>
    
</body>
</html>